package com.qclix.inv.xml;

import java.io.Serializable;
import java.util.Date;

/**
 * WeekDay representation for XML
 */
public class XMLWeekDay implements Serializable {
    private static final long serialVersionUID = 1L;

    private Date date;
    private boolean isWeekend;
    private boolean isHoliday;
    private int workedStdHours;
    private int workedOverTimeHours;
    private boolean partOfInvoice;

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public boolean isWeekend() {
        return isWeekend;
    }

    public void setWeekend(boolean weekend) {
        isWeekend = weekend;
    }

    public boolean isHoliday() {
        return isHoliday;
    }

    public void setHoliday(boolean holiday) {
        isHoliday = holiday;
    }

    public int getWorkedStdHours() {
        return workedStdHours;
    }

    public void setWorkedStdHours(int workedStdHours) {
        this.workedStdHours = workedStdHours;
    }

    public int getWorkedOverTimeHours() {
        return workedOverTimeHours;
    }

    public void setWorkedOverTimeHours(int workedOverTimeHours) {
        this.workedOverTimeHours = workedOverTimeHours;
    }

    public boolean isPartOfInvoice() {
        return partOfInvoice;
    }

    public void setPartOfInvoice(boolean partOfInvoice) {
        this.partOfInvoice = partOfInvoice;
    }

    public int compareTo(XMLWeekDay o) {
        return date.compareTo(o.getDate());
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof XMLWeekDay) {
            return date.equals(((XMLWeekDay) obj).getDate());
        }
        return false;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        XMLWeekDay clone = new XMLWeekDay();
        clone.setDate(new Date(date.getTime()));
        clone.setHoliday(isHoliday);
        clone.setWeekend(isWeekend);
        clone.setWorkedStdHours(workedStdHours);
        clone.setWorkedOverTimeHours(workedOverTimeHours);
        return clone;
    }
}
